var router = require("express").Router();
var PF = require("../controllers/main/page.factory");
var CommonUtils = require("../lib/common-utils");

router.all("/ajax/:type", CommonUtils.Common.RequestExtend, PF.Ajax.Service);
router.all("/ajaxs/:type", CommonUtils.Common.RequestExtend, PF.Ajaxs.Service);
router.all("/oauth/:type", CommonUtils.Common.RequestExtend, PF.OAuth.Service);
router.all("/heepay/:type", CommonUtils.Common.RequestExtend, PF.Heepay.Service);

router.get("/", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Index));
router.get("/index.php", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Index));
router.get("/room/:id?", CommonUtils.Common.RequestExtend, PF.Master.Room(PF.Main.Room));
router.get("/room/:id?/m", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.RoomMobile));
// router.get("/m", CommonUtils.Common.RequestExtend, PF.Master.MobileIndex(PF.Main.MobileIndex));

//临时(GuoJia)
router.get("/channel/channelpage.html", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Index));
router.get("/channel_1/channelpage.html", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Index));

router.get("/channel", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Channel));

//第三方登录成功返回
router.get("/oauthlogin/success", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Oauth.Success));
//user
router.get("/member/users/avatar", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Avatar));
router.get("/member/users/cover", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Cover));
router.get("/member/users/change-password", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Change_Password));
router.get("/member/users/cash", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Cash));
router.get("/report/room/:id", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Report));
router.get("/member/users/IncomeInfo/:id", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.IncomeInfo));
router.get("/member/users/LiveInfo/:id", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.LiveInfo));
router.get("/member/users/user-bound-thirdparty", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Bound_ThirdParty));
router.get("/member/users/user-bound-email", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Bound_Email));
router.get("/member/users/exchange", CommonUtils.Common.RequestExtend, PF.Master.Modal(PF.Member.User.Exchange));

router.get("/modal/buyguard", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Modal.BuyGuard));

router.get("/rank", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Rank));
router.get("/mall/:type?", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Mall));
router.get("/pay", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Pay));

////////////////////
//公会申请菜单
////////////////////
router.get("/entry", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Entry.Index));
router.get("/entry/anchor", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Entry.Anchor));
router.get("/entry/anchor/:step?", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Entry.Anchor_Service));
router.get("/entry/family", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Entry.Family));
router.get("/entry/family/:step?", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Entry.Family_Service));
////////////////////
//用户菜单
////////////////////
router.get("/member/", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Follow));
router.get("/member/user/base_info", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Base_Info));
router.get("/member/user", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Follow));
router.get("/member/user/follow", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Follow));
router.get("/member/user/fans", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Fans));
router.get("/member/user/my_mounts", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.MyMounts));
router.get("/member/user/my_vip", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.MyVIP));
router.get("/member/user/pay_records", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Pay_records));
router.get("/member/user/security", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Security));
router.get("/member/user/consumption", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Gift));
router.get("/member/user/invite", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Invite));
router.get("/member/user/channel-manage", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_User.Channel_Manage));

////////////////////
//用户消费订单
////////////////////
router.get("/member/order/gift", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Gift));
router.get("/member/order/gifts", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Gifts));
router.get("/member/order/guard", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Guard));
router.get("/member/order/vip", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Vip));
router.get("/member/order/mounts", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Mounts));
router.get("/member/order/winning", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Order.Winning));
////////////////////
//艺人菜单
////////////////////
router.get("/member/anchor", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Anchor.Anchor));
router.get("/member/anchor/salary", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Anchor.Anchor_Salary));
router.get("/member/anchor/gift_data", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Anchor.Anchor_Gift));
router.get("/member/anchor/live_data", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Anchor.Anchor_Live));
////////////////////
//公会菜单
////////////////////
router.get("/member/family", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.Income));
router.get("/member/family/income", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.Income));
router.get("/member/family/income/detail/:id", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.Income_Detail));
router.get("/member/family/anchor", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.Anchor));
router.get("/member/family/anchor_income", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.AnchorIncome));
router.get("/member/family/anchor_salary", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.AnchorSalary));
router.get("/member/family/anchor_live", CommonUtils.Common.RequestExtend, PF.Master.Member(PF.Main.Member_Family.AnchorLive));

router.get("/help/:id?", CommonUtils.Common.RequestExtend, PF.Master.Help(PF.Main.Help));
router.get("/search/:key?", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Search));

router.get("/agreement/coin", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Agreement.Coin));
router.get("/agreement/user", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Agreement.User));

router.get("/app/download/m", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.App.Download.Mobile));
router.get("/app/download/pc", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.App.Download.Pc));

router.get("/mobile/pay/", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Mobile.Pay));
router.get("/mobile/login/", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Mobile.Login));

router.get("/activity/2016/firstpay", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Activity.Firstpay));
router.get("/activity/2016/firstpay/m", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Activity.FirstpayMobile));

router.get("/activity/2016/baoming", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Activity.Baoming));

router.get("/zt/zhengjing", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Zt.ZhengJing));
router.get("/zt/yongzhedachongguan", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Zt.Yongzhedachongguan));
router.get("/zt/shitingzheng", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Zt.Shitingzheng));

router.get("/activity/game/lottery", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Game.Lottery));
router.get("/report/anchor", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Report.Room));

router.get("/out_intro/channel", CommonUtils.Common.RequestExtend, PF.Master.Blank(PF.Main.Ads.Intro));

router.get("/forget/:step?", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Forget));

router.get("/help/cert/ycxk", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Cert.Ycxk));
router.get("/help/cert/dxxx", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Cert.Dxxx));
router.get("/help/cert/gbds", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Cert.Gbds));
router.get("/help/cert/wlwh", CommonUtils.Common.RequestExtend, PF.Master.Main(PF.Main.Cert.Wlwh));

////////////////////
//用户中心
////////////////////
router.get("/my/", CommonUtils.Common.RequestExtend, PF.Master.User(PF.Main.User.My.Init));

module.exports = router;